﻿using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Collections.Generic;

namespace JsonCodeGenerator
{
    /// <summary>
    /// 获取全部属性名
    /// </summary>
    internal class GetPropertyWalker : CSharpSyntaxWalker
    {
        public List<string> PropertyNames { get; } = new List<string>();

        public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)
        {
            PropertyNames.Add(node.Identifier.ValueText);

            base.VisitPropertyDeclaration(node);
        }
    }
}
